#ifndef __GPUProcessingTesting__Experiment__
#define __GPUProcessingTesting__Experiment__

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <boost/any.hpp>

#include "TrialsSet.h"
#include "Properties.h"
#include "Timer.h"

#include "StatisticsComputator.h"


class Experiment {
public:
    //Create, destroy
    Experiment(const std::string& title, const std::string& folderPath);
    ~Experiment();
    //.
    
    //make statistics
    void compute_statistics_for_trialsSet () {
        for ( std::vector<TrialsSet>::iterator it_trialSet = trialsSets_.begin(); it_trialSet != trialsSets_.end(); ++it_trialSet )
            StatisticsComputator::compute(*it_trialSet);
    }
    //.
    
    //Writing result
    void writeResultsTo_file            (bool ifEachTrialPrinted = false);
    void writeResultsTo_stdcout         (bool ifEachTrialPrinted = false);
    void writeResultsTo_file_makeRformat();
    //.
    
    Properties properties_; /*common for all trialsSets*/


private:    std::vector< TrialsSet >    trialsSets_;
public:     void add_trialsSet                              (TrialsSet trialsSet) { trialsSets_.push_back(trialsSet); }
    
private:    std::vector< std::string >  trialsSet_propierties_printed_;
public:     void set_trialsSet_propierty_to_print           (std::string title) { trialsSet_propierties_printed_.push_back(title); }
    
private:    std::vector< std::string >  trialsSet_propierty_set_as_mainProperty_;
public:     void set_trialsSet_propierty_as_mainProperty    (std::string title) { trialsSet_propierty_set_as_mainProperty_.push_back(title); }
        
private:
    const std::string folderPath_, title_;
    static const std::string after_main_properties__mark_, after_trialsSet_properties__mark_, before_trialsSet_properties__mark_;
    void writeToStream  (std::ostream& outputStream, bool ifEachTrialPrinted = true);
};


#endif /* defined(__GPUProcessingTesting__Experiment__) */